-
Notifications
You must be signed in to change notification settings - Fork 659
Improves git object cache #4685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@pvanbuijtene: Thank you for your contribution and the work you have done. I have following remarks/suggestions:
|
That was my idea to move the functionality from the GitCache class back into the GitRepository as I think the repository wrapper should handle the caching mechanism as it's the abstraction of the database which maintains the collections and the cache, but we can reconsider that |
Happy to help :) @arturcic as I understand you will implement the suggestions, feel free to ping me in case you want to have some changes tested against a repository causing issues. |
@pvanbuijtene thank you, yeah, I implemented the suggestions so far in this PR, but it's a draft for now, I want to test caching the other collections as well before having this merged |
7393ace
to
ec03709
Compare
e78fba2
to
468ac8d
Compare
Simplifies branch/tag cache keys by including the remote name and SHA.
Renames `GetOrCreate` to `GetOrWrap` to better reflect its caching behavior.
refactors the project to improve code organization and maintainability.
Replaces several internal classes with readonly structs to improve performance by avoiding unnecessary heap allocations. Updates related code to ensure compatibility with the new struct-based implementation.
moves schema and testing projects to misc folder.
Uses lazy initialization to cache references and remotes.
Introduces `GitRepositoryCache` to centralize caching logic for branches, commits, tags, references, and remotes. Updates related classes to use `GitRepositoryCache` instead of directly maintaining individual cache dictionaries.
Replaces `Refs` with `References` across the codebase for better clarity and consistency. Updates all method calls, variable names, and interfaces to reflect this change.
Replaces direct instantiations of Tags, Commits, Remotes, and References with lazy initialization. This avoids redundant object creation and improves performance by deferring instantiation until the collection is accessed.
468ac8d
to
ac0e28b
Compare
|
@pvanbuijtene do you have the time to test this PR on the big repository you have and compare? |
@arturcic sure, the changes seem to have introduced some additional memory usage: |
Follow up for #4681